var cityData = require('../../utils/city.js');


Page({
  data: {
    content: [],
    nv: [],
    px: [],
    qyopen: false,
    qyshow: false,
    nzopen: false,
    pxopen: false,
    nzshow: false,
    pxshow: false,
    isfull: false,
    cityleft: cityData.getCity(),
    citycenter: {},
    cityright: {},
    select1: '',
    select2: '',
    shownavindex: '',
    id1: "办公",
    id2: "奖金",
    id3: "娱乐",
    id4: "学习",
    id5: "红包",
    id6: "交通",
    id7: "书籍",
    id8: "住房",
    id9: "工资",
    id10: "捐赠",
    id11: "日用",
    id12: "服饰",
    id13: "水果",
    id14: "购物",
    id15: "运动",
    id16: "餐饮",
    id17: "返现",
    id18: "投资",
    id19: "兼职",
    id20: "退款",
    id21: "网购",
    id22: "药品",
    id23: "报销",
    id24: "其他",
    screenclass:"其他"
  },
  onLoad: function () {
    this.setData({
      nv: ['收入', '支出']
 
    })
  },
   
  list: function (e) {
    if (this.data.nzopen) {
      this.setData({
        nzopen: false,
        pxopen: false,
        qyopen: false,
        nzshow: false,
        pxshow: true,
        qyshow: true,
        isfull: false,
        shownavindex: 0
      })
    } else {
      this.setData({
        content: this.data.nv,
        nzopen: true,
        pxopen: false,
        qyopen: false,
        nzshow: false,
        pxshow: true,
        qyshow: true,
        isfull: true,
        shownavindex: e.currentTarget.dataset.nav
      })
    }
  },
  listpx: function (e) {
    if (this.data.pxopen) {
      this.setData({
        nzopen: false,
        pxopen: false,
        qyopen: false,
        nzshow: true,
        pxshow: false,
        qyshow: true,
        isfull: false,
        shownavindex: 0
      })
    } else {
      this.setData({
        content: this.data.px,
        nzopen: false,
        pxopen: true,
        qyopen: false,
        nzshow: true,
        pxshow: false,
        qyshow: true,
        isfull: true,
        shownavindex: e.currentTarget.dataset.nav
      })
    }
    console.log(e.target)
  },
  bindDateChange1: function (e) {
    console.log(e.detail.value)
    this.setData({
      dates1: e.detail.value
    })
  },
  bindDateChange2: function (e) {
    console.log(e.detail.value)
    this.setData({
      dates2: e.detail.value
    })
  },
  selectleft: function (e) {

    this.setData({
      cityright: {},
      citycenter: this.data.cityleft[e.currentTarget.dataset.city],
      select1: e.target.dataset.city,
      select2: ''
    });
  },
  selectcenter: function (e) {

    this.setData({
      cityright: this.data.citycenter[e.currentTarget.dataset.city],
      select2: e.target.dataset.city
    });
  },
  hidebg: function (e) {

    this.setData({
      qyopen: false,
      nzopen: false,
      pxopen: false,
      nzshow: true,
      pxshow: true,
      qyshow: true,
      isfull: false,
      shownavindex: 0
    })
  },

  ClickButton:function (event) {
    consloe.log(event.target.id);
    this.setData({screenclass: event.target.id});
  }

})
